package com.example.zhunongzonghe.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.zhunongzonghe.dao.ZnDeliveryAddressMapper;
import com.example.zhunongzonghe.entity.ZnDeliveryAddress;
import com.example.zhunongzonghe.service.IZnDeliveryAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ZnDeliveryAddressServiceImpl extends ServiceImpl<ZnDeliveryAddressMapper, ZnDeliveryAddress> implements IZnDeliveryAddressService {

    @Autowired
    private ZnDeliveryAddressMapper znDeliveryAddressMapper;

    @Override
    public List<ZnDeliveryAddress> queryUserNameAdderss(String userName) {
        LambdaQueryWrapper<ZnDeliveryAddress> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ZnDeliveryAddress::getUsername,userName);
        List<ZnDeliveryAddress> list = znDeliveryAddressMapper.selectList(wrapper);
        return list;
    }
}
